﻿<html lang="zh-cn"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>酷博影视后台管理中心</title>
  <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <link rel="shortcut icon" href="http://q.qlogo.cn/headimg_dl?dst_uin=1017959770&amp;spec=640">
  <script src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
  <script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
 <?php
error_reporting(0);include './pass.php';
function qxg($str){$str=stripslashes($str);$str=str_replace('\'','\\'.'\'',$str);return $str;}
$namess=end(explode('/',$_SERVER['PHP_SELF']));
if($_COOKIE['x_Cookie'] == $用户名 and $_COOKIE['y_Cookie'] == $密码){
}else{
    if(!empty($_POST['adminname'])){
        if($_POST['password'] == $密码 & $_POST['adminname'] == $用户名){
             setcookie("y_Cookie", $密码);
             setcookie("x_Cookie", $用户名);
        }
        else{
            echo"<script>alert('用户名或密码错误!!!');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
            exit;
        }
    }else{?>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="./">酷博影视后台管理中心</a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">

          <li class="active">
            <a href="../"><span class="glyphicon glyphicon-user"></span> 网站首页</a>
          </li>
        </ul>
		</div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->
    <div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
      <div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">用户登陆</h3></div>
        <div class="panel-body">
          <div id="passport-login-pop-api" class="tang-pass-login">
           <form action="./<?php echo $namess;?>" id="TANGRAM__PSP_8__form" class="pass-form pass-form-normal" method="POST" autocomplete="off">
            <p id="TANGRAM__PSP_8__errorWrapper" class="pass-generalErrorWrapper"><span id="TANGRAM__PSP_8__error" class="pass-generalError pass-generalError-error"></span></p>
            
             <div class="input-group">
              <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
              
		
		
            <input id="TANGRAM__PSP_8__userName" type="text" name="adminname"class="form-control" autocomplete="off" placeholder="用户名"></p>
            <p id="TANGRAM__PSP_8__passwordWrapper" class="pass-form-item pass-form-item-password" style="display:">
			</div>
			
			<div class="input-group">
              <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
			<input id="TANGRAM__PSP_8__password" type="password" name="password" class="form-control" placeholder="密码"></p></div>
            <br>
            <div class="form-group">
              <div class="col-xs-12">
            <p id="TANGRAM__PSP_8__submitWrapper" class="col-xs-12"><input id="TANGRAM__PSP_8__submit" type="submit" value="登录" class="btn btn-primary form-control">
             </p>
           </form>

          </div><center>
          &copy;2017 酷博
          
          
          
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
    
   </div>
  </div>
 </body></html>
<?php exit;
    }
}?>

<?php 
	if(empty($_GET['sort'])){$_GET['sort']='index';}?>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="./">酷博影视后台管理中心</a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
		<li class="active">
            <a href="./"><span class="glyphicon glyphicon-user"></span> 后台首页</a>
        </li>
        <li class="active">
            <a href="../"><span class="glyphicon glyphicon-user"></span> 网站首页</a>
        </li>
		<li class="active">
            <a href="?sort=set"><span class="glyphicon glyphicon-cog"></span>网站设置</a>
        </li>
		<li class="active">
            <a href="?sort=admin"><span class="glyphicon glyphicon-lock"></span>账号密码</a>
        </li>
		<li class="active">
            <a href="javascript:history.back(-1)"><span class="glyphicon glyphicon-user"></span>返回上一页</a>
        </li>
		<li class="active">
            <a href="?logout"><span class="glyphicon glyphicon-user"></span>退出登录</a>
		</li>
        </ul>
		</div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->

	<?php if($_GET['sort']=='set'){include './config.php';
	$strm=array(
	array('网站名称','sitename','输入网站全名'),
	array('邮箱','email','输入邮箱'),
	array('短名','simplename','简短名称'),
	array('安装目录','siteurl','输入网站安装目录，开头带/'),
	array('缓存更新时间','hcgx','输入数据缓存更新时间，纯数字，单位为小时'),
	array('友情链接','link','格式：酷博影视|http://v.x-99.cn,酷博直播|http://tv.x-99.cn'),
	array('网站标题','bt','支持yk[key]等模板标签'),
	array('网站关键字','key','支持yk[key]等模板标签'),
	array('网站描述','ms','支持yk[key]等模板标签'),
	array('伪静态开启','rewrite','off|on'),
	array('解析地址','url','按格式 地址1|地址2|地址3等填写'),
	array('解析介绍','gonggao','网站简介'),
        array('导航底部广告','js','支持html'),
	array('底部广告','bad','支持html'),
	array('播放器广告','uad','支持html'),
	array('统计代码','tongji','输入统计代码'));?>	

<script>
var items = $("select[default]");
for (i = 0; i < items.length; i++) {
	$(items[i]).val($(items[i]).attr("default")||0);
}
</script>
    </div>
  </div>
	  
	 <?php if($_GET['mod']=='save'){$strss='<?php ';
	 for($i=0;$i<count($strm);$i++){$guodus=explode('-',$strm[$i][1]);if(count($guodus)==1){$strss.='$config[\''.$guodus[0].'\']=\''.qxg($_POST[$strm[$i][1]]).'\';';}elseif(count($guodus)==2){$strss.='$config[\''.$guodus[0].'\'][\''.$guodus[1].'\']=\''.qxg($_POST[$strm[$i][1]]).'\';';}elseif(count($guodus)==3){$strss.='$config[\''.$guodus[0].'\'][\''.$guodus[1].'\'][\''.$guodus[2].'\']=\''.qxg($_POST[$strm[$i][1]]).'\';';}}
	 $strss.=' ?>';file_put_contents('./config.php',$strss);
	 ?>	
	 <br><div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
<div class="panel panel-success">
      <div class="panel-heading">
        <h3 class="panel-title">提示信息</h3>
        </div>
        <div class="panel-body">修改成功<hr><a href="javascript:history.back(-1)">&lt;&lt; 返回上一页</a></div>
    </div></div></div></p></p><br><?php exit;}?><div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
    <div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">网站信息配置</h3></div>
<div class="panel-body">
  <form action="?sort=set&mod=save" method="post" class="form-horizontal" role="form">
            <?php for($i=0;$i<count($strm);$i++){?>
         
<?php echo $strm[$i][0];?><?php if($i<10){?><input type="text" name="<?php echo $strm[$i][1];?>"class="form-control" autocomplete="off" placeholder="<?php echo $strm[$i][2];?>" class="form-control"  value="<?php echo $config[$strm[$i][1]];?>">
    
    <?php }else{?><textarea rows="6" cols="35%" name='<?php echo $strm[$i][1];?>'class='form-control' style="width:90% "><?php $guodu1=explode('-',$strm[$i][1]);if(is_array($config[$guodu1[0]])){if(is_array($config[$guodu1[0]][$guodu1[1]])){echo $config[$guodu1[0]][$guodu1[1]][$guodu1[2]];}else{echo $config[$guodu1[0]][$guodu1[1]];}}else{echo $config[$guodu1[0]];}?></textarea><?php }?></td>
  </tr>
</table>
</p><?php }?>
            
            <p id="TANGRAM__PSP_8__submitWrapper" class="pass-form-item pass-form-item-submit"><input id="TANGRAM__PSP_8__submit" type="submit" value="确定" class="btn btn-primary form-control">
             </p>
           </form><?php }elseif($_GET['sort']=='admin'){?>
		   
		   <?php if($_GET['mod']=='save'){if(!empty($_POST['name']) and !empty($_POST['pass'])){$strss='<?php $用户名=\''.$_POST['name'].'\'; $密码=\''.$_POST['pass'].'\';?>';file_put_contents('./pass.php',$strss);}else{$zt='n';}
	 ?>	
	 <?php if($zt=='n'){echo '用户名或密码不能为空！';}else{echo '<br><div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
<div class="panel panel-success">
      <div class="panel-heading">
        <h3 class="panel-title">提示信息</h3>
        </div>
        <div class="panel-body">修改成功<hr><a href="javascript:history.back(-1)">&lt;&lt; 返回上一页</a></div>';}?></p></p><br><?php exit;}?>
		   <div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
      <div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">用户登陆</h3></div>
        <div class="panel-body">
		   <form action="?sort=admin&mod=save" method="POST">
            <p id="TANGRAM__PSP_8__errorWrapper" class="pass-generalErrorWrapper"><span id="TANGRAM__PSP_8__error" class="pass-generalError pass-generalError-error"></span></p>
            <br>
            <p id="TANGRAM__PSP_8__userNameWrapper" class="pass-form-item pass-form-item-userName"><table width="90%" border="0" cellspacing="2">
  <tr>
  <div class="input-group">
              <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
            <input type="text" name="name"class="form-control" autocomplete="off" placeholder="输入修改后的用户名">

  </tr>
</table>
</p>
 
 
            <p id="TANGRAM__PSP_8__userNameWrapper" class="pass-form-item pass-form-item-userName"><table width="90%" border="0" cellspacing="2">
  <tr> <div class="input-group">
              <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
			  <input type="text" name="pass"class="form-control" autocomplete="off" placeholder="输入修改后的密码"></td>
  </tr>
</table>
</p>           
            <p id="TANGRAM__PSP_8__submitWrapper" class="pass-form-item pass-form-item-submit"><input id="TANGRAM__PSP_8__submit" type="submit" value="确定" class="btn btn-primary form-control">
             </p>
           </form>
		   
		   <?php }elseif($_GET['sort']=='index'){?>



<div class="container" style="padding-top:70px;">

<div class="panel panel-info">
	<div class="panel-heading">
		<h3 class="panel-title">服务器信息</h3>
	</div>
	<ul class="list-group">
		<li class="list-group-item">
			<b>后台 版本：</b>2.1</li>
		<li class="list-group-item">
			<b>后台 作者：</b>酷博</li>
		<li class="list-group-item">
		<li class="list-group-item">
			<b>酷博影视：</b><a href="http://ys.hanximeng.com" target="_blank">酷博影视</a></li>
	</ul>
</div>
    </div>
  </div>

		   <?php }?>
          </div>
          
          
          
          
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
    
   </div>
  </div></div>
 </body></html>
